package com.ai.bitcoin.util;


import java.util.concurrent.ThreadLocalRandom;

public abstract class IdGeneration {

    public static String getUniqueSign() {
        Long timeStamp = System.currentTimeMillis()/1000L;
        String orderNoStr = String.valueOf(timeStamp);
        String randNumStr = String.valueOf(getRandom());
        return orderNoStr+randNumStr;
    }

    private static Integer getRandom() {
        int randomNum = ThreadLocalRandom.current().nextInt(10000, 99999);
//		Integer rannum = Integer
//				.valueOf(String.valueOf((random.nextDouble() * (99999 - 10000 + 1)) + 10000));// 获取5位随机数
        return randomNum;
    }

    public static void main(String[] args) {
        String orderNo = IdGeneration.getUniqueSign();
//		Integer orderNo = OrderIdGeneration.getRandom();
        System.out.println("orderNo-->"+orderNo);

    }

}
